package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

/**
 *
 */
public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        FileOutputStream file = new FileOutputStream("note.txt");
        while (true) {
            System.out.println("请输入文件");
            String line = scan.nextLine();
            if ("exit".equals(line)) {
                System.out.println("程序终止");
                break;
            }
            byte[] data = line.getBytes(StandardCharsets.UTF_8);
            file.write(data);

        }
        file.close();
    }
}
